import java.util.GregorianCalendar;

public abstract class LendItem {

	private static int _idCounter = 0;
	private int _id;
	protected String _title;
	private String _description;
	private int _overTimeCounter;
	private int _additionalOvertime;
	private int _lendDays;
	private Customer _lendBy;
	private GregorianCalendar _lendDate;

	public LendItem() {
		this("", "");
	}

	public LendItem(String title) {
		this(title, "");
	}

	public LendItem(String title, String desc) {
		_id = LendItem._idCounter++;
		_title = title;
		_description = desc;
	}

	public void lend(Customer c, int lenddays) {
		// TODO schauen ob lenddays passen
		resetStates();
		_lendBy = c;
		_lendDays = lenddays;

	}

	public void returnItem(Customer c) {
		resetStates();
	}

	protected void resetStates() {
		_lendDate = null;
		_lendDays = 0;
		_lendBy = null;
		_overTimeCounter = 0;
		_additionalOvertime = 0;
	}

	public int getId() {
		return _id;
	}

	public String getTitle() {
		return _title;
	}

	public String getDescription() {
		return _description;
	}

}
